package com.hsgene.order.constants.v1;

/**
 * DCW病历类型枚举
 *
 * @author wangbing
 * @version 1.0, 2018/10/25
 */
public enum DcwCaseType {

    /**
     * 病历类型枚举
     */
    COMMON(0, "常规案例"),
    URGENT(1, "急需案例"),
    NORMAL(2, "普通病历"),
    GENETIC_TESTING(3, "基因检测报告病历");

    private final int code;

    private final String value;

    public int getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    DcwCaseType(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public static DcwCaseType getEnum(int code) {
        for (DcwCaseType type : values()) {
            if (type.code == code) {
                return type;
            }
        }

        throw new IllegalStateException("非法的病历类型code值");
    }
}
